﻿@namespace BootstrapBlazor.Components
@typeparam TModel
@inherits DialogBase<TModel>

@if (BodyTemplate != null)
{
    <div class="form-body">
        @BodyTemplate.Invoke(Model)
    </div>
    <div class="form-footer">
        <Button Color="Color.Secondary" Icon="@ClearIcon" Text="@ResetButtonText" OnClickWithoutRender="@OnResetSearchClick" />
        <Button Color="Color.Primary" Icon="@SearchIcon" Text="@QueryButtonText" OnClickWithoutRender="@OnSearchClick" />
    </div>
}
else
{
    <CascadingValue Value="true" IsFixed="true" Name="IsSearch">
        <EditorForm TModel="TModel" Model="Model" Items="Items" RowType="RowType" ItemsPerRow="ItemsPerRow" LabelAlign="LabelAlign" ShowLabel="ShowLabel" ShowUnsetGroupItemsOnTop="ShowUnsetGroupItemsOnTop">
            <Buttons>
                <Button Color="Color.Secondary" Icon="@ClearIcon" Text="@ResetButtonText" OnClickWithoutRender="@OnResetSearchClick" />
                <Button Color="Color.Primary" Icon="@SearchIcon" Text="@QueryButtonText" OnClickWithoutRender="@OnSearchClick" />
            </Buttons>
        </EditorForm>
    </CascadingValue>
}
